﻿<%@ Page Title="" Language="VB" MasterPageFile="~/KYC/MasterPageKYC.master" AutoEventWireup="false"
    CodeFile="chkRiskAllCustomer.aspx.vb" Inherits="KYC_chkRiskAllCustomer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script type="text/javascript">

        $(document).ready(function () {
            Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);


            $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));
            $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                yearAddToDisplay: 543,
                dateFormat: 'dd/mm/yy',
                showOn: "button",
                buttonImage: "../img/calendar.gif",
                buttonImageOnly: true
            }));



            function EndRequestHandler(sender, args) {


                $("input[id$=txtStartDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));
                $("input[id$=txtEndDate]").datepicker($.extend({}, $.datepicker.regional['th'], {
                    yearAddToDisplay: 543,
                    dateFormat: 'dd/mm/yy',
                    showOn: "button",
                    buttonImage: "../img/calendar.gif",
                    buttonImageOnly: true
                }));
            }
        });

        var hasSubmitted = 0;
        function NoDoubleSubmit() {
            var divMsg = document.getElementById('Processing');
            if (hasSubmitted == 0) {
                hasSubmitted = 0;
                divMsg.style.display = 'block';
                return true;
            }
            return false;
        }

        var prm = Sys.WebForms.PageRequestManager.getInstance();

        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);

        function InitializeRequest(sender, args) {
            $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'wait';
        }

        function EndRequest(sender, args) {
            $get('ContentPlaceHolder1_UpdatePanel1').style.cursor = 'auto';
        }

    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width: 100%;">
                <tr>
                    <td align="right">
                        <asp:Label ID="lblDept" runat="server"></asp:Label>
                    </td>
                    <td style="text-align: left; width: 228px;">
                        <asp:DropDownList ID="ddlDepartment" runat="server" AutoPostBack="True" CssClass="control"
                            Height="25px" Width="180px">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right; width: 85px;">
                        <asp:Label ID="lblBranch" runat="server"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" Height="25px"
                            Width="180px">
                        </asp:DropDownList>
                    </td>
                    <td>
                    </td>
                    <td style="text-align: left">
                        <asp:Label ID="Label2" runat="server" Width="239px"></asp:Label>
                    </td>
                </tr>
                  
                <tr>
                    <td colspan="6" style="text-align: right;">
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" Text="ค้นหา" Width="135px" />
                        <asp:Button ID="btnPrint" runat="server" CssClass="control" Text="พิมพ์รายงาน" Width="135px" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: center">
                        <asp:Label ID="lblMsg" runat="server" ForeColor="Red" Text="ไม่พบข้อมูล" Font-Bold="True"
                            Font-Size="30px" Height="30px" Visible="False"></asp:Label>
                        <span id="Processing" style="display: none">
                            <img src="../img/icon/ajax-loader.gif" alt="Please wait" />
                            กรุณารอสักครู่ ระบบกำลังค้นหาข้อมูล... </span>
                        <asp:GridView ID="grdIndividual" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                            CellPadding="4" ForeColor="#333333" Width="100%">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:BoundField HeaderText="รหัสสาขา" DataField="BRANCHCODE">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="70px" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="ชื่อสาขา" DataField="BRANCHNAME">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="250px" HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField HeaderText="ความเสี่ยง 1" DataField="RISK1">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="80px" />
                                </asp:BoundField> 
                                         <asp:BoundField HeaderText="ความเสี่ยง 2" DataField="RISK2">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="80px" />
                                </asp:BoundField> 
                                         <asp:BoundField HeaderText="ความเสี่ยง 3" DataField="RISK3">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="80px" />
                                </asp:BoundField> 
                                          <asp:BoundField HeaderText="ยังไม่เประเมิน" DataField="RISK0">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="80px" />
                                </asp:BoundField> 
                                 <asp:BoundField HeaderText="รวมทั้งสิ้น" DataField="TOTAL">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle Width="80px" />
                                </asp:BoundField> 
                               
                            </Columns>
                            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#FFCC66" CssClass="cssPager" ForeColor="#333333" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#FF9933" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            <div align="right">
                <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
